package com.chinasofti.io;

import java.io.*;

public class Demo02 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("java0419\\fos.txt",true);
        //创建文件输出流添加第二个参数(append:)true每写入文件内容则追加在尾部
        for (int i = 0; i < 10; i++) {
            fos.write("hello".getBytes());
            fos.write("\n".getBytes());
        }
        fos.close();
    }
}
